package org.jeecg.modules.basicSkuDetail.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.jeecg.modules.basicSkuDetail.entity.BasicSkuDetail;
import org.jeecg.modules.basicSkuDetail.mapper.BasicSkuDetailMapper;
import org.jeecg.modules.basicSkuDetail.service.IBasicSkuDetailService;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * @Description: 品番明细表
 * @Author: jeecg-boot
 * @Date:   2023-11-01
 * @Version: V1.0
 */
@Service
public class BasicSkuDetailServiceImpl extends ServiceImpl<BasicSkuDetailMapper, BasicSkuDetail> implements IBasicSkuDetailService {

    @Override
    public BasicSkuDetail getSkuByCustomerCodeAndSkuCode(String customerCode, String skuCode) {
        LambdaQueryWrapper<BasicSkuDetail> wrapper = Wrappers.lambdaQuery();
        wrapper.eq(BasicSkuDetail::getCustomerCode, customerCode);
        wrapper.eq(BasicSkuDetail::getSkuCode, skuCode);
        return baseMapper.selectOne(wrapper);
    }

    @Override
    public BasicSkuDetail getSkuBySkuCode(String skuCode) {
        LambdaQueryWrapper<BasicSkuDetail> wrapper = Wrappers.lambdaQuery();
        wrapper.eq(BasicSkuDetail::getSkuCode, skuCode);
        return baseMapper.selectOne(wrapper);
    }
}
